﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Backend/Backend.Master" Inherits="System.Web.Mvc.ViewPage<IntroduceCompany.ProductListView>" %>
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ProductCreate
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="<%= Url.Content("../../../Content/Backend/js/ckeditor/ckeditor.js")%>"></script>


<!-- Begin one column tab content window -->
    <div class="onecolumn">
        <div class="header">
            <span>Thêm Sản Phẩm Mới</span>
            <div class="switchbutton">
                <a href="<%= Url.Action("ProductListBackend", "Product") %>" class="button">Danh sách</a>
            </div>
        </div>
        <br class="clear" />
        <div class="content">

            <div class="display-label error">
                <div class="errorcontent">
                    <p><%= Html.ValidationMessage("NoticePage")%></p>
                    <p><%= Html.ValidationMessageFor(model => model.ProductID) %></p>
                    <p><%= Html.ValidationMessageFor(model => model.ProductName) %></p>
                    <p><%= Html.ValidationMessageFor(model => model.ProductPrice) %></p>
                    <p><%= Html.ValidationMessageFor(model => model.ProductDescription) %></p>
                </div>
            </div>

            <% using (Html.BeginForm("ProductCreate", "Product", FormMethod.Post))
               {%>
                <%= Html.AntiForgeryToken(IntroduceCompany.Util.AntiKey.EditSalt)%>
                <%= Html.ValidationSummary(true) %>
                <div>
                    <div class="editor_left">
                        <label>Ngôn ngữ</label><br />
                        <%= Html.DropDownListFor(model => model.ProductLanguageID, ViewData["LaguageList"] as SelectList, new { @style = "width:300px;" })%>
                    </div>   
                </div><br class="clear"/><br />
                <div>
                    <div class="editor_left">
                        <label>Mã sản phẩm:</label><br />
                        <%= Html.TextBoxFor(model => model.ProductID, new { Maxlength = "20" })%>
                    </div>   
                    <div class="editor_middle">
                        <label>Loại sản phẩm:</label><br />
                        <%= Html.DropDownListFor(model => model.ProductTypeID, ViewData["DDLProductType"] as SelectList, new { @style = "width:300px;" })%>
                    </div>
                </div><br class="clear"/><br />
                <div>
                    <div class="editor_left">
                        <label>Tên sản phẩm</label><br />
                        <%= Html.TextBoxFor(model => model.ProductName, new { maxlength = "100" })%>
                    </div>   
                    <div class="editor_middle">
                        <div class="editor_fl">
                            <label>Giá sản phẩm: (VND)</label><br />
                            <%= Html.TextBoxFor(model => model.ProductPrice, new { Maxlength = "11", @style = "width:123px;" })%>
                        </div> 
                        <div class="editor_fr">
                            <label>Trạng thái:</label><br />
                            <%= Html.DropDownListFor(model => model.ProductStatusID, ViewData["DDLProductStatus"] as SelectList, new { @style = "width:135px;" })%>
                        </div> 
                    </div>
                </div><br class="clear"/><br />
                <div >
                    <label>Mô tả sản phẩm:</label><br />
                    <%= Html.TextAreaFor(model => model.ProductDescription, new { @class = "ckeditor" })%>
                </div><br class="clear"/>
                <p>
                    <input type="submit" value="Tạo sản phẩm mới" name="action" />
                    <a href="<%= Url.Action("ProductCreate", "Product") %>" class="buttonform">Làm lại</a>
                </p><br class="clear"/>
                <script type="text/javascript">
                    CKEDITOR.replace('ProductDescription', {
                        BasePath: '../../../Content/Backend/js/ckeditor/',
                        customConfig: 'CustomAdmin.js'
                    });
	            </script>
            <% } %>
        </div>
    </div>
</asp:Content>

